Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor graph cache to track qos #107

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

Yadunund
Copy link
Member

@Yadunund Yadunund commented Feb 9, 2024

The PR allows us to keep track of QoS of each Entity within GraphCache. Previously topics with same name and type were considered equivalent. Now, the TopicMap contains the nested TopicTypeMap (renamed from TopicDataMap) which in turn contains the nested TopicQoSMap. The key for the TopicQoSMap, is a string serialization of rmw_qos_profile_t which we already use to include QoS information in liveliness tokens.

With this change, we can keep track of the exact QoS settings used by entities within the GraphCache which makes it easier to check for QoS events.

Also updated in this PR:

  • More accurate removal of topics from the cache when an external node is destroyed before its pub/subs are destroyed.
  • More accurate check for matched pub/sub counts (once events are implemented we can simplify the logic further by returning a tracked count variable).
  • More efficient re-use of code when modifying TopicMap objects within a GraphNode and graph_topics_/graph_services_ caches.

@Yadunund Yadunund merged commit d2398e6 into yadu/events Feb 9, 2024
5 checks passed
@delete-merged-branch delete-merged-branch bot deleted the yadu/refactor_graph_cache_to_track_qos branch February 9, 2024 03:53
Yadunund added a commit that referenced this pull request Mar 26, 2024
* Set callbacks

Signed-off-by: Yadunund <[email protected]>

* Implement EventsBase class

Signed-off-by: Yadunund <[email protected]>

* Declare certain event types to be compatible although mechanisms are not implemented

Signed-off-by: Yadunund <[email protected]>

* Call event callbacks once an event is queued

Signed-off-by: Yadunund <[email protected]>

* Fix typo preventing setting of user callbacks

Signed-off-by: Yadunund <[email protected]>

* Refactor graph cache to track qos (#107)

* Nest TopicQoSMap within TopicDataMap

Signed-off-by: Yadunund <[email protected]>

* Count matched pub/subs based on qos compatibility

Signed-off-by: Yadunund <[email protected]>

* Rename TopicDataMap to TopicTypeMap

Signed-off-by: Yadunund <[email protected]>

---------

Signed-off-by: Yadunund <[email protected]>

* Move eventbase definition into event.hpp

Signed-off-by: Yadunund <[email protected]>

* Update rmw_zenoh_cpp/src/rmw_event.cpp

Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Yadu <[email protected]>

* Store current session id in graph cache

Signed-off-by: Yadunund <[email protected]>

* Allow event callback functions to be registered with graph cache

Signed-off-by: Yadunund <[email protected]>

* Store liveliness::Entity in custom types

Signed-off-by: Yadunund <[email protected]>

* Register qos event callbacks

Signed-off-by: Yadunund <[email protected]>

* Remove all lambdas in graph cache

Signed-off-by: Yadunund <[email protected]>

* Implement matched events

Signed-off-by: Yadunund <[email protected]>

* Make liveliness token keyexprs globally unique

Signed-off-by: Yadunund <[email protected]>

* Add node id to all liveliness tokens

Signed-off-by: Yadunund <[email protected]>

* Debug race condition

Signed-off-by: Yadunund <[email protected]>

* Update qos compatibility check to reflect zenoh's behavior

Signed-off-by: Yadunund <[email protected]>

* Get rid of TopicStats

Signed-off-by: Yadunund <[email protected]>

* Replace EventsBase inheritance with DataCallbackManager and EventsManager objects

Signed-off-by: Yadunund <[email protected]>

* Comment print statements for now. They will be deleted before merge

Signed-off-by: Yadunund <[email protected]>

* Log reason for bad reply

Signed-off-by: Yadunund <[email protected]>

* Remove debug printf statements

Signed-off-by: Yadunund <[email protected]>

* event_mutex_ is a regular mutex

Signed-off-by: Yadunund <[email protected]>

* Update todo for TopicData

Signed-off-by: Yadunund <[email protected]>

* Construct TopicData from Entity

Signed-off-by: Yadunund <[email protected]>

* Restrict query and reply queue sizes

Signed-off-by: Yadunund <[email protected]>

* Simplify codepaths for matched events

Signed-off-by: Yadunund <[email protected]>

* Avoid copying liveliness::Entity

Signed-off-by: Yadunund <[email protected]>

* Handle 0 history depth for publishers too

Signed-off-by: Yadunund <[email protected]>

---------

Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadu <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant